home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 5⁄25⁄90 / 1338-Re assignment to iva-May90 < prev    next >
Encoding:
Text File  |  1990-05-25  |  1.5 KB  |  45 lines  |  [TEXT/GEOL]

  1. Item    3174699                         24-May-90        18:04PDT
  2.  
  3. From:   S.FRIEDRICH                     Friedrich, Steve
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    re> assignment to ivars
  8.  
  9. >On page 331 of "Programming with MacApp" it says not to do this:
  10.  
  11. >        fMyInstanceVariable := FunctionThatMayMoveMemory;
  12.  
  13. >because the address fMyInstanceVariable^^ is computed before the function is
  14. >called. Is this correct??? If so, then I'll have to check a bunch of things in
  15. >my code. Does the code of MacApp really never use such statements?
  16.  
  17. #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
  18. PLEASE NOTE!!!
  19. #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
  20.  
  21. fMyInstanceVariable := FunctionThatMayMoveMemoryORBeInAnotherSegment;
  22.  
  23. is perfectly acceptable!
  24. is perfectly acceptable!
  25. is perfectly acceptable!
  26. However,
  27.  
  28. FunctionThatMayMoveMemoryORBeInAnotherSegment(fMyInstanceVariable); {where
  29. parameter is VAR}
  30.  
  31. is not acceptable because VAR parameters require that the address be taken at
  32. the time the call is made.
  33.  
  34. FunctionThatMayMoveMemoryORBeInAnotherSegment(fMyInstanceVariable); {where
  35. parameter is VAR or not _AND_ fMyInstanceVariable is greater than 4 bytes in
  36. size}
  37.  
  38. may not be acceptable because VAR parameters require that the address be taken
  39. at the time the call is made _AND_ greater than 4 byte parameters are copied
  40. into the callee's  stack frame when they are passed by value.
  41.  
  42. Regards,
  43. Steve
  44.  
  45.